package com.aiju.bean;

/**
 * 异常描述类
 * @author ql
 *
 */
public class ErrorInternal {
	
	/**
	 * 标志位
	 */
	public int what;
	
	/**
	 * 异常代码
	 */
	public int code;
	
	/**
	 * 异常描述
	 */
	public String description;
	
	/**
	 * 异常原因
	 */
	public String failureReason;
	
	/**
	 * 修改异常建议
	 */
	public String recoverySuggestion;
	
	public ErrorInternal() {}

	public ErrorInternal(String description, String failureReason, String recoverySuggestion) {
		this.description = description;
		this.failureReason = failureReason;
		this.recoverySuggestion = recoverySuggestion;
	}

	public ErrorInternal(int what, int code, String description) {
		this.what=what;
		this.code = code;
		this.description = description;
	}
	
	@Override
	public String toString() {
		
		StringBuffer buf = new StringBuffer();
		
		buf.append("code:");
		buf.append(this.code);
		buf.append('\n');

		buf.append("description:");
		buf.append(this.description);
		buf.append('\n');

		buf.append("failureReason:");
		buf.append(this.failureReason);
		buf.append('\n');
		
		buf.append("recoverySuggestion:");
		buf.append(this.recoverySuggestion);
		buf.append('\n');

		return buf.toString();
	}
	
}
